//
//  HLShareManager.m
//  ModuleA
//
//  Created by 胡林虎 on 2017/8/22.
//  Copyright © 2017年 胡林虎. All rights reserved.
//

#import "HLShareManager.h"

@implementation HLShareManager


+(id)loadCurretBundleResouceType:(GFResTypeStyles)ResTypeStyle
                     currentClass:(NSObject *)object
                     bundleName:(NSString *)bundleName
                    resourceName:(NSString *)resName {
    id obj;
    NSBundle *bundle = [NSBundle bundleForClass:[object class]];
    if (ResTypeStyle == GFResXIBType) {
        obj =  [[bundle loadNibNamed:resName owner:nil options:nil] firstObject];
        
    }else if (ResTypeStyle == GFResImageType) {

        NSURL *bundleURL = [bundle URLForResource:bundleName withExtension:@"bundle"];
        NSBundle *resourceBundle = [NSBundle bundleWithURL: bundleURL];
        obj =  resourceBundle?[UIImage imageNamed:resName inBundle:resourceBundle compatibleWithTraitCollection:nil]:[UIImage imageNamed:resName];
        return obj;
        
    }else if (ResTypeStyle == GFResPlistType) {
        obj = [bundle pathForResource:resName ofType:nil];
        
    }
    return obj;
    
}




@end
